<?php
$this->pageTitle = Yii::t('app', 'Manage') . ' ' . GxHtml::encode($model->label());
$this->menu = array(
    array('label' => Yii::t('app', 'Create') . ' ' . $model->label(), 'url' => array('create')),
);
?>
<script type="text/javascript">
    function ChangeStatus(id, status)
    {  
        $.ajax({
            url: "<?php echo $statusChangeUrl; ?>",   
            type: "post", 
            data: "id=" + id + "&status=" + status, 
            dataType:"html",
		
            success: function(msg){
                $('#class-type-grid').yiiGridView.update('class-type-grid');
               
            }
        }); 
    } 
</script>

<h3><?php echo Yii::t('app', 'Manage') . ' ' . GxHtml::encode($model->label(2)); ?></h3>

<?php
$this->widget('zii.widgets.grid.CGridView', array(
    'id' => 'class-type-grid',
    'dataProvider' => $model->search(),
    'filter' => $model,
    'columns' => array(
        'name',
        array(
            'name' => 'status',
            'type' => 'raw',
            'value' => 'changeStatusIngridView($data)',
            'filter' => array('0' => Yii::t('app', 'Inactive'), '1' => Yii::t('app', 'Active')),
        ),
        array(
            'name' => 'create_time',
            'type' => 'raw',
            'value' => 'getDateTime($data->create_time)',
        ),
        array(
            'name' => 'update_time',
            'type' => 'raw',
            'value' => 'getDateTime($data->update_time)',
        ),
        array(
            'class' => 'CButtonColumn',
            'template' => '{view}{update}',
            'buttons' => array(
                'delete' => array(
                    'options' => array('confirm' => 'Are you sure want to delete this class type ? because many class/course dependent on this class type.'),
                ),
            )
        ),
    ),
));
?>